package com.baijia.authentication;

import com.baijia.authentication.handler.exception.AuthenticationException;
import com.baijia.authentication.principal.Credentials;

/**
 * @title AuthenticationManager
 * @desc 认证管理 
 * @author caoliang
 * @date 2015年12月5日
 * @version 1.0
 */
public interface AuthenticationManager {
    
    String AUTHENTICATION_METHOD_ATTRIBUTE = "authenticationMethod";

    /**
     * 认证成功会返回认证信息，失败抛异常
     * 
     * @param 登录凭证
     * @return 完整认证后信息
     * @throws AuthenticationException 
     */
    Authentication authenticate(final Credentials credentials)
        throws AuthenticationException;
}
